package com.nts.pointsstore;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author himagirinathan.t
 */

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;
import android.view.View;
import android.widget.TextView;

public class UserHome extends Activity implements View.OnClickListener
{
   Button bbrowse;
   TextView tvusername,tvpoints,tvemailid,tvstatus;
   private DataHelper dh;
   long id;
   
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle icicle)
    {
        super.onCreate(icicle);
        id=this.getIntent().getExtras().getLong("id");
        this.setContentView(R.layout.userhome);
        bbrowse=(Button)this.findViewById(R.id.browse);
        bbrowse.setOnClickListener(this);
        tvusername=(TextView)this.findViewById(R.id.tvusername);
        tvpoints=(TextView)this.findViewById(R.id.totalpoints);
        tvemailid=(TextView)this.findViewById(R.id.emailid);
        tvstatus=(TextView)this.findViewById(R.id.status);
        dh = new DataHelper(this);
        String strrow[]=dh.selectUserDetails(id);
        tvusername.setText(strrow[0]);
        //tvusername.setTextSize(16.0f);
        tvpoints.setText(strrow[3]);
        //tvpoints.setTextSize(16.0f);
        tvemailid.setText(strrow[1]);
        //tvemailid.setTextSize(16.0f);
        tvstatus.setText(strrow[2]);
        //tvstatus.setTextSize(16.0f);
        
    }

    public void onClick(View arg0)
    {
     Intent it=new Intent(this, ProductList.class);
     Bundle bundle = new Bundle();
     bundle.putLong("id",id);
     it.putExtras(bundle);
     this.startActivity(it);
    }

}
